\hypertarget{class_thread_pool}{\section{Thread\+Pool类 参考}
\label{class_thread_pool}\index{Thread\+Pool@{Thread\+Pool}}
}


线程池  




{\ttfamily \#include $<$Thread\+Pool.\+h$>$}

\subsection*{Public 成员函数}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_thread_pool_a44d3d2ab618970605e684efc216655eb}{$\sim$\+Thread\+Pool} ()
\begin{DoxyCompactList}\small\item\em 线程池析构函数 \end{DoxyCompactList}\item 
bool \hyperlink{class_thread_pool_aced6bffb36b2643b8d613d8f721b3229}{init} (int \hyperlink{class_thread_pool_a019eebc4dc6cfd41d2daca8843fc87c1}{max\+Thread\+Count})
\begin{DoxyCompactList}\small\item\em 线程池初始化 \end{DoxyCompactList}\item 
bool \hyperlink{class_thread_pool_ab5318d91455431c868208c0ed37009dd}{start} (\hyperlink{class_runnable}{Runnable} $\ast$runnable, int priority=0)
\begin{DoxyCompactList}\small\item\em 启动线程 \end{DoxyCompactList}\item 
bool \hyperlink{class_thread_pool_a60016babe5c4af5155740972c9ea8910}{cancel} (\hyperlink{class_runnable}{Runnable} $\ast$runnable)
\begin{DoxyCompactList}\small\item\em 停止线程 \end{DoxyCompactList}\item 
int \hyperlink{class_thread_pool_a019eebc4dc6cfd41d2daca8843fc87c1}{max\+Thread\+Count} ()
\begin{DoxyCompactList}\small\item\em 返回当前线程池最大线程个数 \end{DoxyCompactList}\item 
int \hyperlink{class_thread_pool_aafc6450a99262093d4b25319a20bc087}{idle\+Thread\+Count} ()
\begin{DoxyCompactList}\small\item\em 返回当前可用线程个数 \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{静态 Public 成员函数}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_thread_pool_a425d9481a69be20791ab1cc60e33c8ad}{static \hyperlink{class_thread_pool}{Thread\+Pool} $\ast$ {\bfseries get\+Instance} ()}\label{class_thread_pool_a425d9481a69be20791ab1cc60e33c8ad}

\end{DoxyCompactItemize}


\subsection{详细描述}
线程池 

\subsection{构造及析构函数说明}
\hypertarget{class_thread_pool_a44d3d2ab618970605e684efc216655eb}{\index{Thread\+Pool@{Thread\+Pool}!````~Thread\+Pool@{$\sim$\+Thread\+Pool}}
\index{````~Thread\+Pool@{$\sim$\+Thread\+Pool}!Thread\+Pool@{Thread\+Pool}}
\subsubsection[{$\sim$\+Thread\+Pool}]{\setlength{\rightskip}{0pt plus 5cm}Thread\+Pool\+::$\sim$\+Thread\+Pool (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_thread_pool_a44d3d2ab618970605e684efc216655eb}


线程池析构函数 


\begin{DoxyParams}{参数}
{\em none} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
none 
\end{DoxyReturn}


\subsection{成员函数说明}
\hypertarget{class_thread_pool_a60016babe5c4af5155740972c9ea8910}{\index{Thread\+Pool@{Thread\+Pool}!cancel@{cancel}}
\index{cancel@{cancel}!Thread\+Pool@{Thread\+Pool}}
\subsubsection[{cancel}]{\setlength{\rightskip}{0pt plus 5cm}bool Thread\+Pool\+::cancel (
\begin{DoxyParamCaption}
\item[{{\bf Runnable} $\ast$}]{runnable}
\end{DoxyParamCaption}
)}}\label{class_thread_pool_a60016babe5c4af5155740972c9ea8910}


停止线程 


\begin{DoxyParams}{参数}
{\em runnable} & 线程运行体 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回true,失败返回false 
\end{DoxyReturn}
\hypertarget{class_thread_pool_aafc6450a99262093d4b25319a20bc087}{\index{Thread\+Pool@{Thread\+Pool}!idle\+Thread\+Count@{idle\+Thread\+Count}}
\index{idle\+Thread\+Count@{idle\+Thread\+Count}!Thread\+Pool@{Thread\+Pool}}
\subsubsection[{idle\+Thread\+Count}]{\setlength{\rightskip}{0pt plus 5cm}int Thread\+Pool\+::idle\+Thread\+Count (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_thread_pool_aafc6450a99262093d4b25319a20bc087}


返回当前可用线程个数 


\begin{DoxyParams}{参数}
{\em none} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
线程个数 
\end{DoxyReturn}
\hypertarget{class_thread_pool_aced6bffb36b2643b8d613d8f721b3229}{\index{Thread\+Pool@{Thread\+Pool}!init@{init}}
\index{init@{init}!Thread\+Pool@{Thread\+Pool}}
\subsubsection[{init}]{\setlength{\rightskip}{0pt plus 5cm}bool Thread\+Pool\+::init (
\begin{DoxyParamCaption}
\item[{int}]{max\+Thread\+Count}
\end{DoxyParamCaption}
)}}\label{class_thread_pool_aced6bffb36b2643b8d613d8f721b3229}


线程池初始化 


\begin{DoxyParams}{参数}
{\em max\+Thread\+Count} & 最大线程个数 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回true,失败返回false 
\end{DoxyReturn}
\hypertarget{class_thread_pool_a019eebc4dc6cfd41d2daca8843fc87c1}{\index{Thread\+Pool@{Thread\+Pool}!max\+Thread\+Count@{max\+Thread\+Count}}
\index{max\+Thread\+Count@{max\+Thread\+Count}!Thread\+Pool@{Thread\+Pool}}
\subsubsection[{max\+Thread\+Count}]{\setlength{\rightskip}{0pt plus 5cm}int Thread\+Pool\+::max\+Thread\+Count (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_thread_pool_a019eebc4dc6cfd41d2daca8843fc87c1}


返回当前线程池最大线程个数 


\begin{DoxyParams}{参数}
{\em none} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
线程个数 
\end{DoxyReturn}
\hypertarget{class_thread_pool_ab5318d91455431c868208c0ed37009dd}{\index{Thread\+Pool@{Thread\+Pool}!start@{start}}
\index{start@{start}!Thread\+Pool@{Thread\+Pool}}
\subsubsection[{start}]{\setlength{\rightskip}{0pt plus 5cm}bool Thread\+Pool\+::start (
\begin{DoxyParamCaption}
\item[{{\bf Runnable} $\ast$}]{runnable, }
\item[{int}]{priority = {\ttfamily 0}}
\end{DoxyParamCaption}
)}}\label{class_thread_pool_ab5318d91455431c868208c0ed37009dd}


启动线程 


\begin{DoxyParams}{参数}
{\em runnable} & 线程运行体 \\
\hline
{\em priority} & 线程运行优先级 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回true,失败返回false 
\end{DoxyReturn}


该类的文档由以下文件生成\+:\begin{DoxyCompactItemize}
\item 
libemb/inc/\hyperlink{_thread_pool_8h}{Thread\+Pool.\+h}\item 
libemb/src/Thread\+Pool.\+cpp\end{DoxyCompactItemize}
